<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>简单的JavaScript事件绑定</title>
</head>
<body>
	<h1>简单的 JavaScript 事件绑定</h1><hr>
	<form action="#" method="get" name="myForm" id="myForm">
		<input type="button" name="myButton" id="myButton" value="JavaScript调用">
		<input type="button" name="myButton2" id="myButton2" value="直接调用" onclick="alert('直接调用的事件');">
	</form>
	<script>
		document.myForm.myButton.onclick = new Function("alert('绑定的事件');");
	</script>
</body>
</html>